Communication apparatus

ABSTRACT

In a case where the setting information does not include a frequency band information corresponding to the first frequency band and does not include a frequency band information corresponding to the second frequency band or in a case where the setting information includes the frequency band information corresponding to the first frequency band and the frequency band information corresponding to the second frequency band, the communication apparatus wirelessly connects with the external apparatus using the first frequency band with priority than the second frequency.

CROSS REFERENCE TO RELATED APPLICATIONS

The present application is a continuation of U.S. patent applicationSer. No. 16/548,570 filed Aug. 22, 2019 which is a continuation of U.S.patent application Ser. No. 16/056,239, filed on Aug. 6, 2018 and issuedas U.S. patent Ser. No. 10/430,138 on Oct. 1, 2019, which claimspriority from Japanese Patent Application No. 2017-155517, filed Aug.10, 2017, and Japanese Patent Application No. 2017-155516, filed Aug.10, 2017. The above applications are hereby incorporated by referenceherein in their entireties.

BACKGROUND Field

The present disclosure relates to a communication apparatus.

Description of the Related Art

A technique is known for performing network setting processing towirelessly connect a communication apparatus, such as a printingapparatus, and an external apparatus, such as an access point.

Japanese Patent Application Laid-Open No. 2011-259372 discusses atechnique for connecting an access point and a wireless communicationapparatus when wireless parameters including frequency channels aretransmitted from the access point to the wireless communicationapparatus.

In recent years, communication apparatuses including a plurality ofavailable frequency bands (for example, 2.4 GHz and 5 GHz) have becomepopular. The communication apparatuses also receive information(frequency band information) about the frequency band used to connectwith an external apparatus in the network setting processing andconnects with the external apparatus. However, no consideration has beenprovided regarding control in which, when the communication apparatusreceives a plurality of pieces of frequency band informationcorresponding to a plurality of different frequency bands as frequencyband information in the network setting processing, the communicationapparatuses connect with an external apparatus using a suitablefrequency band out of the plurality of available frequency bands.

SUMMARY

The present disclosure is directed to providing control in which, when acommunication apparatus including a plurality of available frequencybands receives a plurality of pieces of frequency band informationcorresponding to a plurality of different frequency bands, thecommunication apparatus is controlled to connect with an externalapparatus using a suitable frequency band out of the plurality ofavailable frequency bands.

According to an aspect of the present disclosure, a communicationapparatus that wirelessly communicates in a first frequency band and asecond frequency band includes a receiving unit configured to receivesetting information used in processing for wirelessly connecting with anexternal apparatus, a connection unit configured to wirelessly connect,in a case where the setting information does not include a frequencyband information corresponding to the first frequency band and does notinclude a frequency band information corresponding to the secondfrequency band or in a case where the setting information includes thefrequency band information corresponding to the first frequency band andthe frequency band information corresponding to the second frequencyband, with the external apparatus using the first frequency band withpriority than the second frequency, a second receiving unit configuredto receive a print job via the wireless connection with the externalapparatus, and a printing unit configured to perform printing on arecording medium by using a recording agent based on the print job;wherein the first frequency band is a 2.4 GHz frequency band, the secondfrequency band is a 5 GHz frequency band.

According to another aspect of the present disclosure, a communicationapparatus that wirelessly communicates in a first frequency band and asecond frequency band, the communication apparatus includes a firstreceiving unit configured to receive setting information used inprocessing for wirelessly connecting with an external apparatus, aconnection unit configured to wirelessly connect, in a case where thesetting information does not include a frequency band informationcorresponding to the first frequency band and does not include afrequency band information corresponding to the second frequency band orin a case where the setting information includes the frequency bandinformation corresponding to the first frequency band and the frequencyband information corresponding to the second frequency band, with theexternal apparatus using the first frequency band with priority than thesecond frequency, a second receiving unit configured to receive a printjob via the wireless connection with the external apparatus, and aprinting unit configured to perform printing on a recording medium byusing a recording agent based on the print job, wherein, in a case wherethe external apparatus identifies that a specific apparatus isperforming communication through a first channel from among a pluralityof communication channels supporting the second frequency band, achannel currently used in wireless connection using the second frequencyband between the external apparatus and the communication apparatus ischanged from the first channel to a second channel from among theplurality of communication channels supporting the second frequencyband.

Further features will become apparent from the following description ofexemplary embodiments with reference to the attached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic view illustrating a communication system.

FIG. 2 is a schematic view illustrating a configuration of a portableterminal.

FIG. 3 is a schematic view illustrating a configuration of a printingapparatus.

FIGS. 4A to 4D illustrate examples of wireless connection profiles.

FIG. 5 is a flowchart illustrating network setting processing based onan automatic setting method performed by the printing apparatus.

FIG. 6 is a flowchart illustrating the network setting processing basedon the automatic setting method performed by the printing apparatus.

FIG. 7 is a flowchart illustrating another network setting processingusing a terminal apparatus performed by the printing apparatus.

FIG. 8 is a flowchart illustrating the network setting processing usingthe terminal apparatus performed by the printing apparatus.

FIG. 9 is a flowchart illustrating yet another network settingprocessing using the terminal apparatus performed by the printingapparatus.

DESCRIPTION OF THE EMBODIMENTS

An exemplary embodiment will be described in detail below with referenceto the accompanying drawings. Unless otherwise specifically described,relative arrangements of elements and display screens described in thepresent exemplary embodiment are not limited thereto, and the scope ofthe present disclosure is not limited to the exemplary embodiment.

An information processing apparatus and a communication apparatusincluded in a communication system according to a first exemplaryembodiment will be described below. While, in the present exemplaryembodiment, a personal computer (PC) is applied as an example of aninformation processing apparatus, this is not seen to be limiting. Aportable terminal, smart phone, tablet terminal, personal digitalassistant (PDA), digital camera, and other various apparatuses are alsoapplicable as an information processing apparatus. While, in the presentexemplary embodiment, a printer is applied as an example of acommunication apparatus, this is not seen to be limiting. Variousapparatuses capable of wirelessly communicating with an informationprocessing apparatus are also applicable as a communication apparatus.Examples of printers to which the present disclosure is applicableinclude an ink-jet printer, full color laser beam printer, andmonochrome printer. The present disclosure is also applicable not onlyto a printer, but also to a copying machine, facsimile, portableterminal, smart phone, PC, tablet terminal, PDA, digital camera, musicreproduction device, and television. The present disclosure is alsoapplicable to a multifunction peripheral having a plurality of functionssuch as a copy function, FAX function, and printing function.

The following description is of a configuration of the informationprocessing apparatus according to the present exemplary embodiment, anda configuration of the communication apparatus capable of communicatingwith the information processing apparatus according to the presentexemplary embodiment. Although the present exemplary embodiment will bedescribed below centering on the following configuration, the presentexemplary embodiment is applicable to an apparatus capable ofcommunicating with a communication apparatus. In particular, thefunctions of the apparatus are not limited thereto.

FIG. 2 is a block diagram schematically illustrating a terminalapparatus 200 as an information processing apparatus according to thepresent exemplary embodiment.

The terminal apparatus 200 includes a main board 201 for performing maincontrol of the apparatus.

The main board 201 includes a central processing unit (CPU) 202 as asystem control unit for controlling the entire terminal apparatus 200. Aread only memory (ROM) 203 stores various programs to be executed by theCPU 202, such as control programs and an embedded operating system(hereinafter referred to as an OS). According to the present exemplaryembodiment, control programs stored in a read only memory (ROM) 203perform software control, such as scheduling and task switching, undercontrol of the embedded OS stored in the ROM 203. A random access memory(RAM) 204 includes a static RAM and stores program control variables,user-registered setting values, and management data of the terminalapparatus 200. The RAM 204 has various working buffer areas. Thesepieces of setting information data can be stored in other storage areas,such as the ROM 203 and a nonvolatile memory 205, instead of the RAM204.

The nonvolatile memory 205 includes a flash memory and stores data whichneeds to be retained even when power is OFF. More specifically, thenonvolatile memory 205 stores network information including a passwordand authentication information for connecting with a network, andsetting information of the terminal apparatus 200 including a list ofcommunication apparatuses connected in the past (Media Access Control(MAC) address and Service Set Identifier (SSID)). According to thepresent exemplary embodiment, the nonvolatile memory 205 also storesconnection information for easy connection mode (described below). Thesepieces of data can be stored in other storage areas such as the ROM 203and the RAM 204 instead of the nonvolatile memory 205. The CPU 202 canload the setting information stored in the ROM 203 and the nonvolatilememory 205 into the RAM 204 to perform processing by using the storeddata.

An image memory 206 includes a dynamic RAM (DRAM) and stores variousdata such as image data received via a wireless local area network (LAN)unit 211 and image data processed by a coding/decoding processing unit210.

The memory configuration of the terminal apparatus 200 is not limitedthereto. More specifically, the number of memories, memorycharacteristics, and storage capacity can be suitably changed accordingto applications and purposes. For example, the image memory 206 and theRAM 204 can be a common memory. Although the image memory 206 includes aDRAM but not limited thereto. The image memory 206 can include a harddisk drive (HDD) and a nonvolatile memory.

A data conversion unit 207 generates data, such as Page DescriptionLanguage (PDL) data, and performs data conversion, such as colorconversion and image conversion, for image data.

An operation unit 208 and a display unit 209 receive various inputs tothe terminal apparatus 200 and display various information about theterminal apparatus 200.

The coding/decoding processing unit 210 performs coding/decodingprocessing, enlargement/reduction processing, and other variousprocessing on image data.

The wireless LAN unit 211 achieves wireless LAN communication conformingto the Wireless Fidelity (Wi-Fi®) standard. The wireless LAN unit 211has a function of performing beacon detection processing andauthentication processing for establishing a wireless LAN connection,and a function of transmitting a print job to a communication apparatuswith which a wireless LAN connection is established. The wireless LANunit 211 is connected to a system bus 213 via a bus cable 212. The CPU202 is able to control the wireless LAN unit 211 to operate an accesspoint (AP) in the terminal apparatus 200.

According to the present exemplary embodiment, the terminal apparatus200 transmits a print job for instructing the printing apparatus 300 toperform printing via the wireless LAN unit 211. Jobs transmitted to theprinting apparatus 300 are not limited to print jobs and can be scanjobs for instructing the printing apparatus 300 to perform scanning,copy jobs for instructing the printing apparatus 300 to perform copying,and setting commands for changing the settings of the printing apparatus300. When the communication apparatus according to the present exemplaryembodiment is a storage device, data (such as image data and movingimage data) to be stored in the communication apparatus as well as jobscan be transmitted to the printing apparatus 300. When a scan job istransmitted to the printing apparatus 300, image data generated byscanning a document based on the scan job is transmitted to the terminalapparatus 200.

The wireless LAN unit 211 can directly communicate with the printingapparatus 300 via wireless communication or can communicate with theprinting apparatus 300 via an external apparatus outside the terminalapparatus 200 and the printing apparatus 300. External apparatusesinclude access points, such as router apparatuses, and apparatuses otherthan access points capable of relaying communication.

While, in the present exemplary embodiment, the wireless LAN unit 211uses the IEEE 802.11 series standard (Wi-Fi®), Bluetooth® is usable.According to the present exemplary embodiment, a method in which theterminal apparatus 200 and the printing apparatus 300 are directlyconnected without using an external apparatus is referred to as a directconnection method. A method in which the terminal apparatus 200 and theprinting apparatus 300 are connected via an external apparatus isreferred to as an infrastructure connection method. According to thepresent exemplary embodiment, a connection via an access point is to beestablished by the wireless LAN unit 211.

The above-described components 202 to 212 are connected with each othervia the system bus 213 under control of the CPU 202.

The terminal apparatus 200 can include a communication unit other thanthe wireless LAN unit 211. The terminal apparatus 200 can include aplurality of communication units and perform communication based on aplurality of different communication methods. The terminal apparatus 200can also directly communicate with other apparatuses via wirelesscommunication or communicate with other apparatuses via an access pointoutside the terminal apparatus 200 on a network. Examples ofcommunication methods include Bluetooth® Low Energy, Near FieldCommunication (NFC): ISO/IEC IS18092), and Wi-Fi Aware™. In addition,wired communication can be used instead of wireless communication.

FIG. 3 is a block diagram schematically illustrating the printingapparatus 300 as a communication apparatus according to the presentexemplary embodiment.

The printing apparatus 300 includes a main board 301 for performing maincontrol of the apparatus.

The main board 301 includes a CPU 302 as a system control unit forcontrolling the entire printing apparatus 300. A ROM 303 stores variousprograms to be executed by the CPU 302, such as control programs and anembedded OS program. According to the present exemplary embodiment,control programs stored in the ROM 303 perform software control, such asscheduling and task switching, under control of the embedded OS storedin the ROM 303. The RAM 304 includes a SRAM and stores program controlvariables, user-registered setting values, management data of theprinting apparatus 300, and setting information of the mode changeconditions (described below). The RAM 304 has various working bufferareas. These pieces of data can be stored in other storage areas, suchas the ROM 303 and the nonvolatile memory 305, instead of the RAM 304.

The nonvolatile memory 305 includes a flash memory and stores data whichneeds to be retained even when power is OFF. More specifically, thenonvolatile memory 305 stores network information including a passwordand authentication information for connecting with a network, andsetting information of the printing apparatus 300 including a list ofcommunication apparatuses connected in the past (MAC address and SSID),menu items such as printing modes, and recording head correctioninformation. These pieces of setting information data can be stored inother storage areas such as the ROM 303 and the RAM 304 instead of thenonvolatile memory 305. The CPU 302 may load the setting informationstored in the ROM 303 and the nonvolatile memory 305 into the RAM 304 toperform processing by using the setting information.

An image memory 306 includes a dynamic RAM and stores various data suchas image data received via a wireless LAN unit 316 and image dataprocessed by a coding/decoding processing unit 312.

The memory configuration of the printing apparatus 300 is not limitedthereto. More specifically, the number of memories, memorycharacteristics, and storage capacity can be suitably changed accordingto applications and purposes. For example, the image memory 306 and theRAM 304 can be a common memory. Although the image memory 306 includes aDRAM but not limited thereto. The image memory 306 can include an HDDand a nonvolatile memory.

A data conversion unit 307 performs, via an image processing controlunit (not illustrated), various image processing including smoothingprocessing, recording density correction processing, and colorcorrection on image data included in a received job. The data conversionunit 307 performs these pieces of processing to convert the printingtarget image data into high-definition printing data and outputs theconverted printing data to a recording unit 314.

A reading unit 310 optically reads a document by using a Contact ImageSensor (CIS). A reading control unit 308 performs various imageprocessing including binarization processing and intermediate colorprocessing on the image signal obtained through reading by the readingunit 310 and outputs high-definition image data.

An operation unit 309 and a display unit 311 receive various inputs tothe printing apparatus 300 and display various information about theprinting apparatus 300.

The coding/decoding processing unit 312 performs coding/decodingprocessing, enlargement/reduction processing, and other variousprocessing on image data.

A paper feed unit 313 holds recording media for printing and suppliesthe recording media to the recording unit 314 under control of arecording control unit 315. The paper feed unit 313 includes a pluralityof paper cassettes.

The recording control unit 315 controls which paper cassette out of aplurality of the paper cassettes paper is to be fed from. The recordingcontrol unit 315 periodically reads various information such as thestatus of the recording unit 314 to play a role of updating theinformation in the RAM 304. More specifically, the recording controlunit 315 updates the status of the printing apparatus 300, such as “inuse”, “sleeping”, and “error occurred”, and the remaining ink amounts inink tanks.

The recording unit 314 performs image forming processing (printingprocessing) for forming (printing) an image on a recording medium byusing a recording agent such as ink, based on the printing data outputfrom the data conversion unit 307 and print setting information includedin a print job.

The wireless LAN unit 316 is a unit for achieving wireless LANcommunication conforming to the Wi-Fi® standard. The wireless LAN unit316 has a function of performing connection information transmissionprocessing and authentication processing for establishing a wireless LANconnection, and a function of receiving a job from a terminal apparatuswith which a wireless LAN connection is established. The wireless LANunit 316 is connected to a system bus 318 via a bus cable 317. The CPU302 is able to control the wireless LAN unit 211 to operate an accesspoint in the printing apparatus 300. More specifically, the CPU 302 isable to control the printing apparatus 300 to operate as a GroupOwner orsoft AP. According to the present exemplary embodiment, a connection viaan access point is to be established by the wireless LAN unit 316.

The above-described components 302 to 317 are connected with each othervia the system bus 318 under control of the CPU 302.

The printing apparatus 300 can include a communication unit other thanthe wireless LAN unit 316. The printing apparatus 300 can directlycommunicate with other apparatuses via wireless communication orcommunicate therewith via an access point outside the printing apparatus300 installed on a network. According to the present exemplaryembodiment, when directly communicating with other apparatuses, theprinting apparatus 300 operates as a GroupOwner or soft AP. Examples ofcommunication methods include Bluetooth®, NFC, and Wi-Fi Aware™. Theprinting apparatus 300 can communicate with other apparatuses not onlyvia wireless communication but also via wired communication such as acable LAN. The printing apparatus 300 receives a job from other externalapparatuses such as the terminal apparatus 200 via networks conformingto these communication methods. According to the present exemplaryembodiment, the printing apparatus 300 performs direct communication notby using channels supporting the 5 GHz frequency band but by usingchannels supporting the 2.4 GHz frequency band. However, the directcommunication is not limited thereto. For example, the printingapparatus 300 can perform direct communication by using channels withoutswitching through Dynamic Frequency Selection (DFS) to be describedbelow (channels not to be used by a specific apparatus such as a weatherradar) out of the channels supporting the 5 GHz frequency band.According to the present exemplary embodiment, the printing apparatus300 is to use at least either one of the 2.4 GHz and the 5 GHz frequencybands based on the IEEE-802.11 series standard for wireless connection.The printing apparatus 300 is provided with communication channelssupporting the available frequency bands. For example, if the 2.4 GHzfrequency bands are available, the printing apparatus 300 is providedwith 13 communication channels each of which is assigned to a differentone of predetermined frequency bands out of the 2.4 GHz frequency bands.For example, if the 5 GHz frequency bands are available, the printingapparatus 300 is provided with 24 communication channels each of whichis assigned to a different one of predetermined frequency bands out ofthe 5 GHz frequency bands.

FIG. 1 illustrates the communication system according to the presentexemplary embodiment. The communication system according to the presentexemplary embodiment includes the terminal apparatus 200, the printingapparatus 300, and an access point 400. The printing apparatus 300 andthe terminal apparatus 200 establish a wireless LAN connection via theaccess point 400 outside each apparatus, whereby the apparatuses cancommunicate with each other. Each of the printing apparatus 300 and theterminal apparatus 200 is also able to operate as an access point byenabling the access point in each apparatus. Therefore, for example, ifeither one apparatus serves as an access point and the other apparatusconnects with the access point, the terminal apparatus 200 and theprinting apparatus 300 are able to directly establish a wireless LANconnection without using the access point 400. Since both the terminalapparatus 200 and the printing apparatus 300 have a wireless LANfunction, peer-to-peer (hereinafter referred to as P2P) communication isachieved through mutual authentication.

The access point 400 is a router apparatus. A router apparatus is anapparatus for relaying data communication between apparatuses (forexample, between an information processing apparatus and a communicationapparatus). According to the present exemplary embodiment, a routerapparatus serves as an access point and relays data communicationbetween apparatuses connected to the access point of the routerapparatus. The router apparatus can use a wireless communication method,a wired communication method, or both communication methods. Accordingto the present exemplary embodiment, the router apparatus has a wirelessLAN router function for enabling communication at least with a wirelesscommunication method.

According to the present exemplary embodiment, the printing apparatus300 is connected to the access point 400 via a wireless LAN. Morespecifically, the terminal apparatus 200 is capable of communicatingwith the printing apparatus 300 via the access point 400. Morespecifically, the terminal apparatus 200 connects with the printingapparatus 300 via an infrastructure connection. Establishing aninfrastructure connection enables the printing apparatus 300 and theterminal apparatus 200 to communicate with apparatuses belonging to anetwork formed by the access point 400. When the access point 400 isconnected to the Internet, the printing apparatus 300 and the terminalapparatus 200 can also use the Internet via the access point 400.

The present exemplary embodiment will be described below centering on aconfiguration for executing setting processing (network settingprocessing) for establishing a connection between the printing apparatus300 and the access point 400 to establish the above-describedinfrastructure connection.

As a more specific example of a method for network setting processing,the terminal apparatus 200 transmits network setting information to theprinting apparatus 300 to establish a connection between the printingapparatus 300 and the access point 400. Examples of network settinginformation include connection information (SSID and a password) usedfor connection with the access point 400 as a connection target of theprinting apparatus 300. When the printing apparatus 300 requests theaccess point 400 for connection, the printing apparatus 300 transmitsthe connection information to the access point 400. For example, othermethods for network setting processing include AirStation One-TouchSecure System (AOSS™), Rakuraku Musen Start (Easy Wireless Start), andWi-Fi Protected Setup™ (WPS). In these methods, when the printingapparatus 300 receives the network setting information directly from theaccess point 400 without using the terminal apparatus 200, a connectionbetween the printing apparatus 300 and the access point 400 isestablished. Hereinafter, these methods are referred to as automaticsetting methods.

A wireless connection is performed by using a specific frequency band.In recent years, an apparatus capable of using a plurality of frequencybands (for example, 2.4 GHz and 5 GHz frequency bands) has been used asthe printing apparatus 300. The printing apparatus 300 according to thepresent exemplary embodiment is also capable of performing wirelessconnection by using a plurality of frequency bands. When connecting withan access point, the printing apparatus 300 first searches for accesspoints (AP search) by using the communication channels supporting theavailable frequency bands. Then, the printing apparatus 300 transmits aconnection request to the access point corresponding to thethus-received connection information by using the communication channelsupporting the available frequency band to wirelessly connect with theaccess point.

Therefore, if the thus-configured printing apparatus 300 does not knowwhich frequency band is to be used to wirelessly connect with an accesspoint, the printing apparatus 300 is unable to connect with the accesspoint. For example, the printing apparatus 300 may be configured toexecute an AP search by using the available frequency bands to tryestablishing a connection with an access point even if the printingapparatus 300 does not know which frequency band is to be used. However,since the printing apparatus 300 is generally unable to simultaneouslyuse a plurality of frequency bands, the printing apparatus 300 willsequentially use the available frequency bands one by one in theabove-described configuration. In this case, the printing apparatus 300may try establishing a connection by using frequency bands other thanthe frequency bands for connecting with an access point. Morespecifically, even in the above-described configuration, the printingapparatus 300 may consume time to connect with an access point orperform useless processing.

In network setting processing, it is desirable that information aboutfrequency bands (frequency band information) available for theconnection target access point is notified to the printing apparatus300. The frequency band information is also information about thefrequency band to be used for connection with the connection targetaccess point.

The frequency band information may not be notified to the printingapparatus 300 depending on the method for network setting processing,the model and installed software type of the connection target accesspoint, and the model and installed software type of the terminalapparatus 200 performing the network setting processing. As a morespecific example, in WPS, the frequency band information may not benotified to the printing apparatus 300 since whether the frequency bandinformation is notified to the printing apparatus 300 depends on themodel of the access point. For example, depending on the type of the OSmounted on the terminal apparatus 200, the terminal apparatus 200 may beunable to acquire the frequency band information and therefore, forexample, the information may not be notified to the printing apparatus300. This causes an issue that the printing apparatus 300 is unable todetermine which frequency band is to be used in the network settingprocessing.

For example, when the connection target access point supports aplurality of frequencies, a plurality of pieces of frequency bandinformation may be notified. As a more specific example, bothinformation corresponding to the 2.4 GHz band and informationcorresponding to the 5 GHz band may be notified as frequency bandinformation. Also, in this case, an issue may arise, i.e., the printingapparatus 300 is unable to determine which frequency band out of aplurality of frequency bands is to be used in the network settingprocessing.

The present exemplary embodiment will be described below centering on aconfiguration in which, even if the frequency band information is notnotified to the printing apparatus 300 in the network settingprocessing, the printing apparatus 300 tries establishing a connectionwith an access point by using a suitable frequency band.

The present exemplary embodiment will also be described below centeringon a configuration in which, even if a plurality of pieces ofinformation about frequency bands available for the connection targetaccess point is notified to the printing apparatus 300 in the networksetting processing, the printing apparatus 300 tries establishing aconnection with the access point by using a suitable frequency band.

More specifically, in the above-described case, the printing apparatus300 tries establishing a connection by using 2.4 GHz with priority over5 GHz. The following describes the reason why, in the present exemplaryembodiment, the printing apparatus 300 tries establishing a connectionwith an access point by using 2.4 GHz with priority over 5 GHz.

According to the present exemplary embodiment, the printing apparatus300 is able to simultaneously (in parallel) operate in both a mode forperforming communication via an infrastructure connection(infrastructure communication mode) and a mode for performingcommunication via a direct connection (direct communication mode (P2Pmode)). Therefore, the printing apparatus 300 is able to simultaneously(in parallel) establish and maintain both the infrastructure and thedirect connections.

The direct connection is a connection in a wireless network configuredby the printing apparatus 300 and the terminal apparatus 200. Either oneof the printing apparatus 300 and the terminal apparatus 200 serves asan AP (master station, parent station) and the other (non-AP apparatus)serves as a client (slave station, child station). In the wirelessnetwork according to the present exemplary embodiment, the printingapparatus 300 serves as an AP in the direct connection mode. The directcommunication mode includes the Wi-Fi Direct® (WFD) mode in which theprinting apparatus 300 operates as a GroupOwner and the soft AP mode inwhich the printing apparatus 300 operates as a soft AP. The SSID andpassword of the AP enabled by the printing apparatus 300 are differentin each mode.

The infrastructure connection is a connection in a wireless networkconfigured by the access point 400. The infrastructure connection is aconnection in a wireless network configured by the access point 400serving as an AP (master station) and the printing apparatus 300 servingas a client (slave station).

Hereinafter, an operation in which the printing apparatus 300 and theterminal apparatus 200 simultaneously (in parallel) establish aninfrastructure connection and a direct connection and simultaneously (inparallel) operate for communication via the infrastructure and thedirect connections is referred to as a simultaneous operation. In thesimultaneous operation, the terminal apparatus 200 with which theprinting apparatus 300 is connected via the direct connection isdifferent from the terminal apparatus 200 with which the printingapparatus 300 is connected via the infrastructure connection. Morespecifically, the printing apparatus 300 is connectable with a pluralityof apparatuses through the simultaneous operation.

Communication via the infrastructure connection and communication viathe direct connection are performed by using specific frequency bands(specific channels). Therefore, in both communication via theinfrastructure connection and communication via the direct connection,the channel to be used for communication and connection between theapparatuses before starting communication is determined. In acommunication configuration in which a plurality of channels issimultaneously assigned to one wireless integrated circuit (IC) chip,each apparatus will have a complicated configuration and performcomplicated processing. Therefore, for example, when the printingapparatus 300 performs the simultaneous operation, it is desirable thata common channel is used in communication in each mode. Morespecifically, even during the simultaneous operation, it is desirablethat the printing apparatus 300 uses only one channel. Therefore,according to the present exemplary embodiment, the wireless LAN unit 316includes only one wireless IC chip for achieving communication through apredetermined channel, and the printing apparatus 300 does not performcommunication by simultaneously using a plurality of channels.

If the printing apparatus 300 is operating as a GroupOwner or soft AP,the printing apparatus 300 as a master station can arbitrarily determinethe channel to be used for the direct connection. However, the channelto be used for the infrastructure connection is determined by the accesspoint 400 which serves as a master station in the infrastructureconnection. Therefore, when the printing apparatus 300 performs thesimultaneous operation, it is desirable to determine as a channel to beused for the direct connection the channel to be used for theinfrastructure connection determined by the access point 400.

However, in the direct connection using the channel supporting 5 GHz, aDFS function (described below) is applied. Depending on the apparatusconfiguration, the existence of this function may make it impossible orundesirable for the printing apparatus 300 to perform the directconnection by using the channel supporting 5 GHz. As a more specificexample, it may be impossible or undesirable for the wireless IC chipincluded in the wireless LAN unit 316 to operate as a GroupOwner or softAP (i.e., master station) by using the channel supporting 5 GHz. DFSwill be described below.

In communication using a specific frequency band such as 5 GHz, theapparatus operating as a GroupOwner or soft AP, and the master stationsuch as the access point 400 needs to perform a technique called DFS.DFS is a technique for controlling apparatuses so that communicationtherebetween does not affect a weather radar. When a specific apparatussuch as a weather radar is using a specific frequency, an interferencewave is generated by the specific frequency. DFS is also a technique forswitching the frequency (channel) used by the master station amongspecific frequency bands including the specific frequency. Morespecifically, when the master station detects an interference wave inthe frequency currently being used by the master station, the masterstation stops communication based on the specific frequency band for apredetermined time period (for example, for one minute). During thecommunication stop, the printing apparatus 300 confirms whether a newchannel to be used after canceling the communication stop is available(whether the frequency corresponding to the channel is being used by aspecific apparatus such as a weather radar). When the printing apparatus300 confirms that the channel is available, the master station cancelsthe communication stop and resumes communication based on the newchannel. An operation of a certain master station to detect aninterference wave in a frequency currently being used for communicationby the master station corresponds to an operation of the master stationto identify that a specific apparatus such as a weather radar is usingthe frequency currently being used for communication by the masterstation. A technique called Transmit Power Control (TPC) is also asimilar technique to DFS.

When the master station detects that a specific apparatus, such as aweather radar, is using the communication channel currently being used,it is the master station in the communication system that needs toperform control for switching the communication channel currently beingused. When the communication channel currently being used is switched bythe master station, the slave station follows this processing. Morespecifically, also in the infrastructure connection through 5 GHz, whenthe access point 400 switches the channel through DFS, the printingapparatus 300 switches the channel following the channel switching.

DFS and TPC are applied to communication in specific frequency bandssuch as 5 GHz and are not applied to communication in frequency bandssuch as 2.4 GHz. More specifically, the printing apparatus 300 does notswitch the channel currently being used for communication in the 2.4 GHzfrequency band depending on the communication status of a specificapparatus, such as a weather radar. This is because a specificapparatus, such as a weather radar, performs communication by using the5.0 GHz frequency band but does not perform communication by using the2.4 GHz frequency band. More specifically, when communication betweenapparatuses is performed by using the 5 GHz frequency band, channelswitching is performed through DFS and TPC. When channel switching isperformed through DFS, as described above, channel switching isperformed between the channels supporting the 5 GHz frequency band.

When the printing apparatus 300 using a wireless chip not conforming toDFS serves as a master station, the printing apparatus 300 is unable toswitch, through DFS, the communication channel currently being used andis unable to perform direct connection through 5 GHz. As describedabove, the channels to be used for the infrastructure and the directconnections are shared in the simultaneous operation. The printingapparatus 300 which is unable to perform the direct connection through 5GHz has an issue that the printing apparatus 300 is unable to performthe simultaneous operation when it uses 5 GHz in the infrastructureconnection.

Since the printing apparatus 300 uses a wireless chip conforming to DFS,there remains the following issue even if the direct connection through5 GHz can be performed. As described above, the channel to be used forthe direct connection may be changed through DFS. However, in thesimultaneous operation, the channels to be used for the infrastructureand the direct connections are shared, and the channel to be used forthe infrastructure connection cannot be determined by the printingapparatus 300. More specifically, even if the channel to be used for thedirect connection is changed through DFS during the simultaneousoperation, the channel to be used for the infrastructure connectioncannot be changed by the printing apparatus 300. Therefore, the channelsto be used for the infrastructure and the direct connections cannot beshared. Therefore, there is an issue that the infrastructure and thedirect connections cannot be maintained in parallel.

Even if the printing apparatus 300 can use both the 2.4 GHz and the 5GHz frequency bands, it is desirable to use 2.4 GHz with priority over 5GHz taking the execution of the simultaneous operation intoconsideration.

Also in the printing apparatus 300 that does not perform thesimultaneous operation, the following issue may arise when theinfrastructure connection is performed through 5 GHz. When channelswitching is performed through DFS as described above, communicationbetween the apparatuses is stopped for a predetermined time period.Therefore, for example, a delay or packet loss may occur incommunication between apparatuses through 5 GHz.

Therefore, if the frequency band information is not notified to theprinting apparatus 300 according to the present exemplary embodiment inthe network setting processing, the printing apparatus 300 triesestablishing a connection with the access point 400 by using 2.4 GHzwith priority over 5 GHz. In the network setting processing, when aplurality of pieces of information about frequency bands available forthe connection target access point is notified to the printing apparatus300, the printing apparatus 300 uses 2.4 GHz with priority over 5 GHzfor connection with the access point 400.

Meanwhile, there is an advantage of using 5 GHz. For example, generally,communication through 5 GHz provides a higher transmission rate andhigher stability than communication through 2.4 GHz. The access point400 supports 5 GHz and may not support 2.4 GHz. Therefore, when theprinting apparatus 300 according to the present exemplary embodiment isnotified only of information about 5 GHz as the frequency bandinformation or is instructed to use 5 GHz by the user, the printingapparatus 300 according to the present exemplary embodiment triesestablishing a connection with the access point 400 using 5 GHz.

The network setting processing based on the automatic setting methodwill be described below.

FIG. 5 is a flowchart illustrating the network setting processing basedon the automatic setting method performed by the printing apparatus 300according to the present exemplary embodiment. The flowchart illustratedin FIG. 5 is implemented, for example, when the CPU 302 reads a programstored in the ROM 303 or the nonvolatile memory 305 into the RAM 304 andthen executes the program. The processing of the flowchart illustratedin FIG. 5 is started when a user operation as a trigger for the networksetting processing (an instruction for executing the network settingprocessing) based on the automatic setting method is performed. Morespecifically, the user operation as a trigger for the network settingprocessing based on the automatic setting method is an operation ofpressing a predetermined button included in the printing apparatus 300.

In step S501, the CPU 302 operates the printing apparatus 300 in theautomatic setting mode. The automatic setting mode is a mode in whichthe printing apparatus 300 performs the network setting processing basedon the automatic setting method. When step S501 is performed in a statewhere the printing apparatus 300 is operating in the direct connectionmode, the printing apparatus 300 temporarily stops the operation as anAP. According to the present exemplary embodiment, information about theoperation mode of the printing apparatus 300 is prestored in anoperation mode storage area in a predetermined memory. Even when theprocessing in step S501 is performed in a state where the printingapparatus 300 is operating in the direct connection mode, informationindicating that the direct connection mode is enabled is to be kept inthe operation mode storage area.

The network setting processing based on the automatic setting method isperformed in a state where not only the printing apparatus 300 but alsothe access point 400 as a connection target of the printing apparatus300 operates in the automatic setting mode. Similarly to the printingapparatus 300, the access point 400 starts an operation as the automaticsetting mode when a predetermined button is pressed by the user.

When the printing apparatus 300 and the access point 400 startoperations in the automatic setting mode, each apparatus sends a signalindicating that it is operating in the automatic setting mode. Whenthese signals are acquired between the apparatuses, each apparatusdetects an apparatus subjected to the network setting processing basedon the automatic setting method. Then, the apparatuses establish aconnection with each other to exchange information (wireless connectionprofile) for performing the network setting processing based on theautomatic setting method.

In step S502, the CPU 302 determines whether the printing apparatus 300connects with an access point operating in the automatic setting mode.In a case where the CPU the CPU 302 determines that the printingapparatus 300 connects with an access point (YES in step S502), theprocessing proceeds to step S503. On the other hand, in a case where theCPU 302 determines that the printing apparatus 300 does not connect withan access point (NO in step S502), the processing proceeds to step S505.

In step S505, the CPU 302 determines whether a predetermined time haselapsed (timeout occurred) from when the printing apparatus 300 hasstarted the operation as the automatic setting mode. In a case where theCPU 302 determines that timeout occurred (YES in step S505), the CPU 302determines that an error occurs and ends the processing. On the otherhand, in a case where the CPU 302 determines that timeout has notoccurred (NO in step S505), the processing returns to step S502.

The access point 400 that has connected with the printing apparatus 300operating in the automatic setting mode transmits a wireless connectionprofile to the printing apparatus 300. The wireless connection profilerefers to information including the connection information to be usedfor connection with the access point 400. When the access point 400 hasa plurality of SSIDs, the wireless connection profile includes aplurality of profiles corresponding to respective SSIDs. FIG. 4Aillustrates an example of a wireless connection profile acquired throughAOSS™. The wireless connection profile acquired through AOSS™ includesup to eight profiles. FIG. 4B illustrates an example of a wirelessconnection profile acquired through Rakuraku Musen Start. The wirelessconnection profile acquired through Rakuraku Musen Start includes up totwo profiles. FIGS. 4C and 4D illustrate examples of wireless connectionprofiles acquired through WPS. A wireless connection profile acquiredthrough WPS includes up to six profiles.

As illustrated in FIGS. 4A to 4D, one profile includes “SSID”,“Frequency”, “Authentication Method”, “Coding Method”, and “Passphrase”.By using each piece of information included in one profile, the printingapparatus 300 is able to connect with an access point. As a morespecific example, in order to connect with an access point having thewireless connection profile illustrated in FIG. 4A by using “AOSS-1” asthe SSID, the printing apparatus 300 uses the 2.4 GHz frequency band.Information included in “Frequency” may not be information indicatingthe frequency corresponding to each SSID but can be, for example,information indicating the channel corresponding to each SSID. Asdescribed above, since a wireless connection profile acquired throughWPS may not include information about “Frequency” (see FIG. 4D), theinformation about frequency bands available for the access point may notbe notified to the printing apparatus 300.

In step S503, the CPU 302 determines whether a wireless connectionprofile is received from the connected access point. In a case where theCPU 302 determines that a wireless connection profile is received (YESin step S503), the processing proceeds to step S504. A wirelessconnection profile received from the access point includes a pluralityof profiles. Therefore, when a wireless connection profile is received,the CPU 302 identifies the number (n) of profiles included in thewireless connection profile. On the other hand, in a case where the CPU302 determines that a wireless connection profile is not received (NO instep S503), the processing proceeds to step S506.

In step S506, the CPU 302 determines whether a predetermined time haselapsed (timeout occurred) from when the printing apparatus 300 hasstarted the operation as the automatic setting mode. In a case where theCPU 302 determines that timeout has occurred (YES in step S506), the CPU302 determines that an error occurs and ends the processing. On theother hand, in a case where the CPU 302 determines that timeout has notoccurred (NO in step S506), the processing returns to step S503.

In step S504, the CPU 302 initializes a wireless connection profilecounter variable m. More specifically, the CPU 302 assigns 1 to thewireless connection profile counter variable m. The wireless connectionprofile counter variable m is information stored in, for example, thenonvolatile memory 305.

In step S507, the CPU 302 determines whether the m-th profile out of then profiles indicates that the connection target access point supports2.4 GHz. More specifically, the CPU 302 determines whether the“Frequency” column of the m-th profile out of the n profiles includesinformation indicating “2.4 GHz” or information indicating “Channelsupporting 2.4 GHz”. In a case where the CPU 302 determines that the“Frequency” column includes information indicating 2.4 GHz (YES in stepS507), the processing proceeds to step S508. On the other hand, in acase where the CPU 302 determines that the “Frequency” column does notinclude information indicating 2.4 GHz (NO in step S507), the processingproceeds to step S511.

In step S511, the CPU 302 determines whether the m-th profile out of then profiles indicates that the connection target access point supports 5GHz. More specifically, the CPU 302 determines whether the “Frequency”column of the m-th profile out of the n profiles includes informationindicating “5 GHz” or information indicating “Channel supporting 5 GHz”.In a case where the CPU 302 determines that the “Frequency” columnincludes information indicating 5 GHz (YES in step S511), the processingproceeds to step S512. On the other hand, in a case where the CPU 302determines that the “Frequency” column does not include informationindicating 5 GHz (NO in step S511), the processing proceeds to stepS513.

In a case where the CPU 302 determines that the “Frequency” column doesnot include information indicating 2.4 GHz (NO in step S507) anddetermines that the “Frequency” column does not include informationindicating 5 GHz (NO in step S511), the m-th profile out of the nprofiles does not include information about the frequency band.Therefore, the frequency band information is not notified for the m-thprofile out of the n profiles. As described above, in such a case, thepresent exemplary embodiment uses 2.4 GHz with priority over 5 GHz.

In step S513, the CPU 302 searches for an access point having the SSIDcorresponding to the m-th profile out of the n profiles by using thechannel supporting 2.4 GHz.

In step S514, the CPU 302 determines whether an access point having theSSID corresponding to the m-th profile out of the n profiles is detectedin search in step S513. In a case where the CPU 302 determines that anaccess point is detected (YES in step S514), the processing proceeds tostep S508. On the other hand, in a case where the CPU 302 determinesthat an access point is not detected (NO in step S514), the processingproceeds to step S515.

In step S515, the CPU 302 searches for an access point having the SSIDcorresponding to the m-th profile out of the n profiles by using thechannel supporting 5 GHz.

In step S516, the CPU 302 determines whether an access point having theSSID corresponding to the m-th profile out of the n profiles is detectedin search in step S515. In a case where the CPU 302 determines that anaccess point is detected (YES in step S516), the processing proceeds tostep S512. On the other hand, in a case where the CPU 302 determinesthat an access point is not detected (NO in step S516), the CPU 302determines that an error has occurred and ends the processing.

According to the present exemplary embodiment, the CPU 302 performs asearch (search through 2.4 GHz) in step S513 before a search (searchthrough 5 GHz) in step S515 in this way to use 2.4 GHz with priorityover 5 GHz.

In step S508, the CPU 302 stores the m-th profile in a storage area in apredetermined memory, such as the nonvolatile memory 305, which alsoserves as a storage area (storage area for 2.4 GHz) for the connectioninformation of an access point connectable through 2.4 GHz.

In step S512, the CPU 302 stores the m-th profile in a storage area in apredetermined memory, such as the nonvolatile memory 305, which alsoserves as a storage area (storage area for 5 GHz) for the connectioninformation of an access point connectable through 5 GHz.

In step S509, the CPU 302 increments the wireless connection profilecounter variable m.

In step S510, the CPU 302 determines whether the incremented wirelessconnection profile counter variable m exceeds the number (n) of profilesincluded in the wireless connection profile. In a case where the CPU 302determines that the variable m exceeds the number (n) of profiles (YESin step S510), the processing proceeds to step S517. On the other hand,in a case where the CPU 302 determines that the variable m does notexceed the number (n) of profiles (NO in step S510), the processingreturns to step S507. When this processing is repeated in this way, eachof the profiles included in the wireless connection profile is stored inthe storage area for 2.4 GHz or the storage area for 5 GHz.

Processing in step S517 and subsequent steps will be described belowwith reference to FIG. 6. The flowchart illustrated in FIG. 6 isimplemented, for example, when the CPU 302 reads a program stored in theROM 303 or the nonvolatile memory 305 into the RAM 304 and then executesthe program.

In step S517, the CPU 302 determines whether profile is stored in thestorage area for 2.4 GHz. More specifically, the CPU 302 determineswhether the connection target access point is an access pointconnectable through 2.4 GHz. In a case where the CPU 302 determines thatprofile is stored in the storage area for 2.4 GHz (YES in step S517),the processing proceeds to step S518. On the other hand, in a case wherethe CPU 302 determines that profile is not stored in the storage areafor 2.4 GHz (NO in step S517), the processing proceeds to step S523.

In step S518, the CPU 302 tries establishing a connection with theconnection target access point by using the information stored in thestorage area for 2.4 GHz and the channel supporting 2.4 GHz. When aplurality of profiles is stored in the storage area for 2.4 GHz, the CPU302 tries establishing a connection by sequentially using theseprofiles. Although, in this case, the order of using the profiles is notparticularly limited, a profile with an encryption method orauthentication method having a high security level may be used withpriority over other ones. As a more specific example, a profile with the“WPA2-PSK” authentication method may be used with priority over aprofile with the “OPEN” authentication method. As a more specificexample, the priority of encryption methods may be as follows:“AES”>“TKIP”>“WEP128”>“WEP64”. Although the CPU 302 tries establishing aconnection with the connection target access point by sequentially usinga plurality of channels supporting 2.4 GHz until connection issuccessful, the order of channels to be used is not particularlylimited.

In step S519, the CPU 302 determines whether a connection with theconnection target access point has been successful in step S518. In acase where the CPU 302 determines that the connection has beensuccessful (YES in step S519), the processing proceeds to step S520. Onthe other hand, in a case where the CPU 302 determines that theconnection has not been successful (NO in step S519), the processingproceeds to step S523.

In step S520, the CPU 302 stores the profile that has been used for thesuccessful connection in a predetermined memory such as the nonvolatilememory 305. At this timing, a connection through 2.4 GHz between theprinting apparatus 300 and the access point is completed, andaccordingly an infrastructure connection through 2.4 GHz can beestablished. Then, the CPU 302 operates the printing apparatus 300 inthe infrastructure connection mode through 2.4 GHz.

In step S521, the CPU 302 determines whether the operation mode storagearea includes information indicating that the direct connection mode isenabled. In a case where the CPU 302 determines that the operation modestorage area stores the information (YES in step S521), the processingproceeds to step S522. On the other hand, in a case where the CPU 302determines that the operation mode storage area does not store theinformation (NO in step S521), the CPU 302 ends the processing.

In step S522, the CPU 302 operates the printing apparatus 300 in thedirect connection mode. If the printing apparatus 300 operates in theinfrastructure connection mode at this timing, the simultaneousoperation will be performed. As described above, the channel to be usedin the simultaneous operation is the channel currently being used in theinfrastructure connection mode. Even if the channel that has been usedin the direct connection mode before the network setting processing isperformed differs from the channel currently being used in theinfrastructure connection mode, the latter channel will be used in thedirect connection mode after the network setting processing isperformed.

On the other hand, in a case where the CPU 302 determines that profileinformation is not stored in the storage area for 2.4 GHz (NO in stepS517), a profile is stored in the storage area for 5 GHz. Then, in stepS523, the CPU 302 tries establishing a connection with the connectiontarget access point by using the information stored in the storage areafor 5 GHz and the channel supporting 5 GHz. In this case, when aplurality of profiles is stored in the storage area for 5 GHz, the CPU302 tries establishing a connection by sequentially using theseprofiles. Although, in this case, the order of using the profiles is notparticularly limited, a profile with an encryption method orauthentication method having a high security level may be used withpriority over other ones. Although the CPU 302 tries establishing aconnection with the connection target access point by sequentially usinga plurality of channels supporting 5 GHz until connection is successful,the order of channels to be used is not particularly limited.

In step S524, the CPU 302 determines whether a connection with theconnection target access point has been successful in step S523. In acase where the CPU 302 determines that the connection has beensuccessful (YES in step S524), the processing proceeds to step S525. Onthe other hand, in a case where the CPU 302 determines that theconnection has not been successful (NO in step S524), the processingproceeds to step S521.

In step S525, the CPU 302 stores the profile that has been used for thesuccessful connection in a predetermined memory such as the nonvolatilememory 305. At this timing, a connection through 5 GHz between theprinting apparatus 300 and the access point is completed, andaccordingly an infrastructure connection through 5 GHz can beestablished. Then, the CPU 302 operates the printing apparatus 300 inthe infrastructure connection mode through 5 GHz.

In step S526, the CPU 302 determines whether the operation mode storagearea includes information indicating that the direct connection mode isenabled. In a case where the CPU 302 determines that the operation modestorage area stores the information (YES in step S526), the processingproceeds to step S527. On the other hand, in a case where the CPU 302determines that the operation mode storage area does not store theinformation (NO in step S526), the CPU 302 ends the processing.

In step S527, the CPU 302 disables the direct connection mode. Morespecifically, the CPU 302 updates the information stored in theoperation mode storage area to information indicating that the directconnection mode is disabled. This is because, as described above, someissues arise in the simultaneous operation through 5 GHz. At thistiming, the CPU 302 may display a screen for notifying the user that thedirect connection mode will be disabled on the display unit 311.

The printing apparatus 300 is able to operate in the direct connectionmode by receiving a predetermined operation directly from the user viathe operation unit 309. However, according to the present exemplaryembodiment, when the printing apparatus 300 operates in theinfrastructure connection mode through 5 GHz, the printing apparatus 300does not operate in the direct connection mode (i.e., the simultaneousoperation is not performed). Therefore, when the predetermined operationis received in a state where the printing apparatus 300 operates in theinfrastructure connection mode through 5 GHz, the CPU 302 may display ascreen for confirming whether the infrastructure connection mode can becanceled on the display unit 311. Then, when the CPU 302 confirms thatthe infrastructure connection mode may be canceled based on a useroperation, the CPU 302 cancels the infrastructure connection modethrough 5 GHz and operates the printing apparatus 300 in the directconnection mode. Cancelling the infrastructure connection mode through 5GHz is equivalent to disconnecting the connection with the access pointthrough 5 GHz. Instead of this configuration, for example, when theprinting apparatus 300 operates in the infrastructure connection modethrough 5 GHz, the printing apparatus 300 may be configured not toreceive a predetermined operation for operating it in the directconnection mode.

The following describes the network setting processing using theterminal apparatus 200.

FIG. 7 is a flowchart illustrating the network setting processing usingthe terminal apparatus 200 performed by the printing apparatus 300according to the present exemplary embodiment. The flowchart illustratedin FIG. 7 is implemented, for example, when the CPU 302 reads a programstored in the ROM 303 or the nonvolatile memory 305 into the RAM 304 andthen executes the program. The processing of the flowchart illustratedin FIG. 7 is started when a user operation as a trigger for the networksetting processing (an instruction for executing the network settingprocessing) using the terminal apparatus 200 is performed on theprinting apparatus 300.

In step S701, the CPU 302 operates the printing apparatus 300 in apredetermined mode called a setup mode when a user operation as atrigger for the network setting processing is performed. The setup modeis a mode in which the printing apparatus 300 receives the networksetting processing. When step S701 is performed in a state where theprinting apparatus 300 operates in the direct connection mode, theprinting apparatus 300 once stops the operation as an AP. Even when stepS701 is performed in a state where the printing apparatus 300 operatesin the direct connection mode, information indicating that the directconnection mode is enabled has been kept in the operation mode storagearea. Examples of user operations as a trigger for the network settingprocessing include an operation for a predetermined screen for operatingthe printing apparatus 300 in the setup mode and an operation forshifting the printing apparatus 300 in the initial setting state fromthe power OFF state to the power ON state. The initial setting state isa state where the printing apparatus 300 has not yet once performed thenetwork setting processing.

In step S702, the CPU 302 performs AP search as processing for searchingfor access points existing around the printing apparatus 300 by usingthe channel supporting 2.4 GHz. Thus, an access point connectablethrough 2.4 GHz is searched.

In step S703, the CPU 302 performs AP search by using the channelsupporting 5 GHz. Thus, access points connectable through 5 GHz aresearched.

In step S704, the CPU 302 stores a result of AP search performed insteps S702 and S703 in a memory, such as the RAM 304. The result of APsearch includes, for example, a list of access points detected in APsearch, connection information for connecting with the access points,information about frequencies and channels used for access point search.The AP search allows the CPU 302 to determine which frequencies andchannels has been used to detect which access points. More specifically,the CPU 302 can identify frequencies and channels available for accesspoints detected in AP search.

In step S705, the CPU 302 enables a predetermined access point in theprinting apparatus 300 enabled only in the setup mode. The predeterminedaccess point has the SSID including a predetermined character string.

The network setting processing using the terminal apparatus 200 isperformed when the setup program as a program for performing the networksetting processing is used by the terminal apparatus 200. The terminalapparatus 200 searches for the above-described predetermined accesspoint when a user operation as a trigger for the network settingprocessing (an instruction for executing the network setting processing)is performed on a screen displayed by the setup program. Then, when theterminal apparatus 200 detects the above-described predetermined accesspoint, the terminal apparatus 200 establishes a Wi-Fi® direct connectionwith the printing apparatus 300 via the predetermined access point byusing the connection information prestored in the setup program.

In step S706, the CPU 302 determines whether the printing apparatus 300has established a direct connection with the terminal apparatus 200 viathe above-described predetermined access point. In a case where the CPU302 determines that the printing apparatus 300 has established a directconnection with the terminal apparatus 200 (YES in step S706), theprocessing proceeds to step S707. On the other hand, in a case where theCPU 302 determines that the printing apparatus 300 has not established adirect connection with the terminal apparatus 200 (NO in step S706), theprocessing proceeds to step S708.

In step S708, the CPU 302 determines whether a predetermined time haselapsed (timeout occurred) from when the printing apparatus 300 hasstarted an operation in the setup mode. In a case where the CPU 302determines that timeout has occurred (YES in step S708), the CPU 302determines that an error has occurred and ends the processing. On theother hand, in a case where the CPU 302 determines that timeout has notoccurred (NO in step S708), the processing returns to step S706.

In step S707, the CPU 302 transmits the AP search result to the terminalapparatus 200.

In step S709, the CPU 302 determines whether the network settinginformation has been received from the terminal apparatus 200. Thenetwork setting information transmitted from the terminal apparatus 200can be information for connecting with the access points included in theAP search result transmitted by the printing apparatus 300, informationfor connecting with the access points included in the AP search resulttransmitted by the terminal apparatus 200, or information for connectingwith an access point specified by the user via the terminal apparatus200. The printing apparatus 300 can receive the network settinginformation in a plurality of steps instead of receiving the informationat one time. In a case where the CPU 302 determines that the networksetting information has been received from the terminal apparatus 200(YES in step S709), the processing proceeds to step S711. On the otherhand, in a case where the CPU 302 determines that the network settinginformation has not been received from the terminal apparatus 200 (NO instep S709), the processing proceeds to step S710. According to thepresent exemplary embodiment, the network setting informationtransmitted from the terminal apparatus 200 includes, as frequency bandinformation, information indicating the channel to be used by theconnection target access point. Referring to the channel information,the CPU 302 can identify whether the channel supports the 2.4 GHzfrequency band or supports the 5 GHz frequency band.

In step S710, the CPU 302 determines whether a predetermined time haselapsed (timeout occurred) from when the printing apparatus 300 hasstarted an operation in the setup mode. In a case where the CPU 302determines that timeout has occurred (YES in step S710), the CPU 302determines that an error has occurred and ends the processing. On theother hand, in a case where the CPU 302 determines that timeout has notoccurred (NO in step S710), the processing returns to step S709.

In step S711, the CPU 302 disables the predetermined access point in theprinting apparatus 300 which is disabled only in the setup mode. Morespecifically, the CPU 302 once disconnects the connection with theterminal apparatus 200.

In step S712, the CPU 302 determines whether the network settinginformation received from the terminal apparatus 200 includesinformation indicating that the frequency to be used by the connectiontarget access point is 2.4 GHz. In a case where the CPU 302 determinesthat the network setting information includes information indicating 2.4GHz (YES in step S712), the processing proceeds to step S713. On theother hand, in a case where the CPU 302 determines that the networksetting information does not includes information indicating 2.4 GHz (NOin step S712), the processing proceeds to step S714.

In step S713, the CPU 302 stores the network setting informationreceived from the terminal apparatus 200 in the storage area for 2.4GHz.

In step S714, the CPU 302 determines whether the network settinginformation received from the terminal apparatus 200 includesinformation indicating that the frequency to be used by the connectiontarget access point is 5 GHz. In a case where the CPU 302 determinesthat the network setting information includes information indicating 5GHz (YES in step S714), the processing proceeds to step S715. On theother hand, in a case where the CPU 302 determines that the networksetting information does not include information indicating 5 GHz (NO instep S714), the processing proceeds to step S716.

In step S715, the CPU 302 stores the network setting informationreceived from the terminal apparatus 200 in the storage area for 5 GHz.

In a case where the CPU 302 determines that the network settinginformation does not include information indicating 2.4 GHz (NO in stepS712) and determines that the network setting information does notinclude information indicating 5 GHz (NO in step S714), the networksetting information received from the terminal apparatus 200 does notinclude information about the frequency to be used by the connectiontarget access point. As described above, the present exemplaryembodiment uses 2.4 GHz with priority over 5 GHz. In step S716,therefore, the CPU 302 identifies that the frequency to be used by theconnection target access point is 2.4 GHz.

Processing in step S717 and subsequent steps will be described belowwith reference to FIG. 8. The flowchart illustrated in FIG. 8 isimplemented, for example, when the CPU 302 reads a program stored in theROM 303 or the nonvolatile memory 305 into the RAM 304 and then executesthe program.

In step S717, the CPU 302 determines whether the network settinginformation is stored in the storage area for 2.4 GHz. Morespecifically, the CPU 302 determines whether the connection targetaccess point is an access point connectable through 2.4 GHz. In a casewhere the CPU 302 determines that the network setting information isstored in the storage area for 2.4 GHz (YES in step S717), theprocessing proceeds to step S718. On the other hand, in a case where theCPU 302 determines that the network setting information is not stored inthe storage area for 2.4 GHz (NO in step S717), the processing proceedsto step S724.

In step S718, the CPU 302 stores the network setting information, whichis stored in the storage area for 2.4 GHz, in a predetermined memorysuch as the nonvolatile memory 305.

In step S719, the CPU 302 tries establishing a connection with theconnection target access point by using the network setting informationstored in the storage area for 2.4 GHz and the channel supporting 2.4GHz. According to the present exemplary embodiment, as described above,the frequency band information is information indicating the channel.Therefore, the CPU 302 tries establishing a connection with theconnection target access point by using the channel indicated by theinformation out of the channels supporting 2.4 GHz.

In step S720, the CPU 302 determines whether a connection with theconnection target access point has been successful in step S719. In acase where the CPU 302 determines that the connection has beensuccessful (YES in step S720), the processing proceeds to step S721. Onthe other hand, when the CPU 302 determines that the connection has notbeen successful (NO in step S720), the processing proceeds to step S722.In a case where a connection with the connection target access point hasbeen successful, a connection through 2.4 GHz between the printingapparatus 300 and the access point is completed, and accordingly aninfrastructure connection through 2.4 GHz can be established. Therefore,the CPU 302 operates the printing apparatus 300 in the infrastructureconnection mode through 2.4 GHz.

In step S722, the CPU 302 displays a screen indicating that a connectionwith the connection target access point has failed on the display unit311. In this case, the CPU 302 can transmit to the terminal apparatus200 information for displaying a screen indicating that a connectionwith the connection target access point has failed on the display unit209. Also, in step S725, the CPU 302 can try establishing a connectionwith the connection target access point by using the channel supporting5 GHz. The CPU 302 can try establishing a connection with the connectiontarget access point by using a channel other than the channel used instep S719 out of the channels supporting 2.4 GHz.

In step S721, the CPU 302 determines whether the operation mode storagearea includes information indicating that the direct connection mode isenabled. In a case where the CPU 302 determines that the operation modestorage area includes the information (YES in step S721), the processingproceeds to step S723. On the other hand, in a case where the CPU 302determines that the operation mode storage area does not include theinformation (NO in step S721), the CPU 302 ends the processing.

In step S723, the CPU 302 operates the printing apparatus 300 in thedirect connection mode. This processing is similar to the processing instep S522.

In a case where the network setting information is stored in the storagearea for 2.4 GHz (NO in step S717), the network setting information isincluded in the storage area for 5 GHz. Therefore, in step S724, the CPU302 stores the network setting information, which is stored in thestorage area for 5 GHz, in a predetermined memory such as thenonvolatile memory 305.

In step S725, the CPU 302 tries establishing a connection with theconnection target access point by using the network setting informationstored in the storage area for 5 GHz and the channel supporting 5 GHz.According to the present exemplary embodiment, as described above, thefrequency band information is information indicating the channel.Therefore, the CPU 302 tries establishing a connection with theconnection target access point by using the channel indicated by theinformation out of the channels supporting 5 GHz.

In step S726, the CPU 302 determines whether a connection with theconnection target access point in step S725 has been successful. Whenthe CPU 302 determines that the connection has been successful (YES instep S726), the processing proceeds to step S727. On the other hand, ina case where the CPU 302 determines that the connection has not beensuccessful (NO in step S726), the processing proceeds to step S728. In acase where a connection with the connection target access point has beensuccessful, a connection through 5 GHz between the printing apparatus300 and the access point is completed, and accordingly an infrastructureconnection through 5 GHz can be established. Therefore, the CPU 302operates the printing apparatus 300 in the infrastructure connectionmode through 5 GHz.

In step S728, the CPU 302 displays a screen indicating that a connectionwith the connection target access point has failed on the display unit311. In this case, the CPU 302 can transmit to the terminal apparatus200 information for displaying a screen indicating that a connectionwith the connection target access point has failed on the display unit209. Then, in step S719, the CPU 302 can try establishing a connectionwith the connection target access point by using the channel supporting2.4 GHz. The CPU 302 can also try establishing a connection with theconnection target access point by using a channel other than the channelused in step S728 out of the channels supporting 5 GHz.

In step S727, the CPU 302 determines whether the operation mode storagearea includes information indicating that the direct connection mode isenabled. In a case where the CPU 302 determines that the operation modestorage area includes the information (YES in step S727), the processingproceeds to step S729. On the other hand, in a case where the CPU 302determines that the operation mode storage area does not include theinformation (NO in step S727), the CPU 302 ends the processing.

In step S729, the CPU 302 disables the direct connection mode. Thisprocessing is similar to the processing in step S522.

The following describes a configuration for suitably executing thenetwork setting processing via the terminal apparatus 200 based on amethod different from the one in the above-described configuration.

FIG. 9 is a flowchart illustrating the network setting processingperformed by the printing apparatus 300 according to the presentexemplary embodiment. The flowchart illustrated in FIG. 9 isimplemented, for example, when the CPU 302 reads a program stored in theROM 303 or the nonvolatile memory 305 into the RAM 304 and then executesthe program. The processing of the flowchart illustrated in FIG. 9 isstarted when a user operation as a trigger for the network settingprocessing (an instruction for executing the network setting processing)is performed on the printing apparatus 300.

Processing in steps S901 to S916 is similar to the processing in stepsS701 to S716, respectively, and redundant descriptions thereof will beomitted.

In a case where the CPU 302 determines that the network settinginformation does not include information indicating 5 GHz (NO in stepS914), the network setting information received from the terminalapparatus 200 does not include the frequency band information.Therefore, in step S917, the CPU 302 determines whether the AP searchresult stored in step S904 includes the information included in thenetwork setting information received from the terminal apparatus 200.Examples of the information included in the network setting informationreceived from the terminal apparatus 200 include a SSID, anauthentication method, an encryption method, and a MAC address. In acase where the CPU 302 determines that the AP search result includes theinformation (YES in step S917), the processing proceeds to step S918. Onthe other hand, in a case where the CPU 302 determines that the APsearch result does not include the information (NO in step S917), theprocessing proceeds to step S916. In a case where the CPU 302 determinesthat the AP search result includes the information (YES in step S917),the CPU 302 identifies from the AP search result the frequencyinformation corresponding to the information included in the networksetting information received from the terminal apparatus 200.

In step S918, the CPU 302 determines whether the frequency information,which is identified from the AP search result, corresponding to theinformation included in the network setting information received fromthe terminal apparatus 200 is 2.4 GHz. In a case where the CPU 302determines that the frequency information indicates 2.4 GHz, (YES instep S918), the processing proceeds to step S913. On the other hand, ina case where the CPU 302 determines that the frequency information doesnot indicate 2.4 GHz (NO in step S918), the processing proceeds to stepS915.

Processing after steps S913 and S915 is similar to the processingillustrated in FIG. 8, and redundant descriptions thereof will beomitted.

Although the printing apparatus 300 is described to receive the networksetting information for setting the infrastructure connection mode fromthe terminal apparatus 200, the printing apparatus 300 can receive thenetwork setting information for setting the direct connection mode fromthe terminal apparatus 200. In this case, after the printing apparatus300 notifies the terminal apparatus 200 of the connection informationfor connecting with an access point in the printing apparatus 300 whichwill be enabled in the direct connection mode, the printing apparatus300 enables the access point and then establishes a direct connectionwith the terminal apparatus 200.

It is desirable for the terminal apparatus 200 to transmit, as thenetwork setting information for setting the infrastructure connectionmode, information for connecting with the access point with which theterminal apparatus 200 has connected before the network settingprocessing. This allows the printing apparatus 300 to connect with theaccess point. Then, if the terminal apparatus 200 re-connects with theaccess point, an infrastructure connection is established between theterminal apparatus 200 and the printing apparatus 300.

With the above-described configuration, if the frequency bandinformation is not notified to the printing apparatus 300 in the networksetting processing, the CPU 302 can try establishing a connection withan access point by using 2.4 GHz with priority over 5 GHz. When aplurality of pieces of information about the frequency bands availablefor the connection target access point is notified to the printingapparatus 300 in the network setting processing, the CPU 302 can tryestablishing a connection with an access point by using 2.4 GHz withpriority over 5 GHz.

Although the printing apparatus 300 is described to support at leasteither one of the 2.4 GHz and the 5 GHz frequency bands, theconfiguration of the printing apparatus 300 is not limited thereto. Morespecifically, the printing apparatus 300 can support frequency bandsother than the 2.4 GHz and the 5 GHz frequency bands. The printingapparatus 300 can support three or more frequency bands.

The printing apparatus 300 is described to connect with APs by using thechannels supporting the 2.4 GHz frequency band with priority, if nofrequency band information is received or a plurality of pieces offrequency band information is received in the network settingprocessing. However, the configuration of the printing apparatus 300 isnot limited thereto. For example, in the above-described configuration,the printing apparatus 300 can connect with APs by preferentially usingchannels with which switching through DFS is not performed (channels notto be used by a specific apparatus such as a weather radar), out of thechannels supporting the 5 GHz frequency band.

In the above-described configuration, the printing apparatus 300receives the network setting information in a state where the printingapparatus 300 operates in the setup mode, and the printing apparatus 300and the terminal apparatus 200 are connected with each other throughWi-Fi® in the network setting processing using the terminal apparatus200. However, the configuration of the printing apparatus 300 is notlimited thereto. For example, the printing apparatus 300 can receive thesetting information via a non-Wi-Fi® communication method in a statewhere the printing apparatus 300 and the terminal apparatus 200 areconnected with each other through a non-Wi-Fi® communication method. Asa more specific example, the printing apparatus 300 can start anoperation when an operation as a trigger for an operation in the setupmode is performed in a state where communication with the host terminal102 based on a communication method other than Wireless LAN (WLAN) ispossible. Examples of non-WLAN communication methods include Bluetooth®Classic, Bluetooth® Low Energy, and NFC.

The above-described exemplary embodiment is also implemented byperforming the following processing. More specifically, software(program) for implementing the functions of the above-describedexemplary embodiments is supplied to a system or apparatus via a networkor various types of storage media, and a computer (or CPU or microprocessing unit (MPU)) of the system or apparatus reads and executes theprogram. The program may be executed by either one computer or aplurality of computers in a collaborated way. Not all of theabove-described processing need to be implemented by software. A part orwhole of the processing may be implemented by hardware such as anApplication Specific Integrated Circuit (ASIC). One CPU do notnecessarily perform the entire processing, i.e., a plurality of CPUs maysuitably perform processing in a cooperative way.

Embodiment(s) can also be realized by a computer of a system orapparatus that reads out and executes computer executable instructions(e.g., one or more programs) recorded on a storage medium (which mayalso be referred to more fully as a ‘non-transitory computer-readablestorage medium’) to perform the functions of one or more of theabove-described embodiment(s) and/or that includes one or more circuits(e.g., application specific integrated circuit (ASIC)) for performingthe functions of one or more of the above-described embodiment(s), andby a method performed by the computer of the system or apparatus by, forexample, reading out and executing the computer executable instructionsfrom the storage medium to perform the functions of one or more of theabove-described embodiment(s) and/or controlling the one or morecircuits to perform the functions of one or more of the above-describedembodiment(s). The computer may comprise one or more processors (e.g.,central processing unit (CPU), micro processing unit (MPU)) and mayinclude a network of separate computers or separate processors to readout and execute the computer executable instructions. The computerexecutable instructions may be provided to the computer, for example,from a network or the storage medium. The storage medium may include,for example, one or more of a hard disk, a random-access memory (RAM), aread only memory (ROM), a storage of distributed computing systems, anoptical disk (such as a compact disc (CD), digital versatile disc (DVD),or Blu-ray Disc (BD)™), a flash memory device, a memory card, and thelike.

While exemplary embodiments have been described, it is to be understoodthat the invention is not limited to the disclosed exemplaryembodiments. The scope of the following claims is to be accorded thebroadest interpretation so as to encompass all such modifications andequivalent structures and functions.

What is claimed is:
 1. A communication apparatus that wirelesslycommunicates in a first frequency band and a second frequency band, thecommunication apparatus comprising: a first receiving unit configured toreceive setting information used in processing for wirelessly connectingwith an external apparatus; a connection unit configured to wirelesslyconnect, in a case where the setting information does not include afrequency band information corresponding to the first frequency band anddoes not include a frequency band information corresponding to thesecond frequency band or in a case where the setting informationincludes the frequency band information corresponding to the firstfrequency band and the frequency band information corresponding to thesecond frequency band, with the external apparatus using the firstfrequency band with priority than the second frequency; a secondreceiving unit configured to receive a print job via the wirelessconnection with the external apparatus; and a printing unit configuredto perform printing on a recording medium by using a recording agentbased on the print job; wherein the first frequency band is a 2.4 GHzfrequency band, and wherein the second frequency band is a 5 GHzfrequency band.